package com.zzoranor.util;


public class Log {
	
	public static final int VERBOSE = 0;
	public static final int DEBUG = 1;
	public static final int WARN = 2;
	public static final int ERROR = 3;
	
	private static int currentPrintLevel = VERBOSE;
	
	public static void i(String s)
	{
		if(currentPrintLevel <= VERBOSE)
		{
			System.out.println("VERBOSE: \t" + s);
		}
	}
	
	public static void d(String s)
	{
		if(currentPrintLevel <= DEBUG)
		{
			System.out.println("DEBUG: \t" + s);
		}
	}
	
	public static void w(String s)
	{
		if(currentPrintLevel <= WARN)
		{
			System.out.println("WARN: \t" + s);
		}
	}
	
	public static void e(String s)
	{
		if(currentPrintLevel <= ERROR)
		{
			System.out.println("ERROR: \t" + s);
		}
	}
	
	public static void printStackTrace(Exception e)
	{
		e.printStackTrace();
	}
	
	public static void setPrintLevel(int lvl)
	{
		currentPrintLevel = (lvl >= VERBOSE && lvl <= ERROR) ? lvl : currentPrintLevel;
	}
	
	public static int getPrintLevel()
	{
		return currentPrintLevel;
	}
}
